﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DTO
{
    public class DauSachDTO
    {
        int _ID,
            _LuongTon;
        String _Ten,
            _TheLoai,
            _TacGia;

        public System.String TacGia
        {
            get { return _TacGia; }
            set { _TacGia = value; }
        }

        public System.String TheLoai
        {
            get { return _TheLoai; }
            set { _TheLoai = value; }
        }

        public System.String Ten
        {
            get { return _Ten; }
            set { _Ten = value; }
        }

        public int LuongTon
        {
            get { return _LuongTon; }
            set { _LuongTon = value; }
        }

        public int ID
        {
            get { return _ID; }
            set { _ID = value; }
        }

        public DauSachDTO()
        {
            _ID = 0;
            _LuongTon = 0;
            _Ten = String.Empty;
            _TheLoai = String.Empty;
            _TacGia = String.Empty;
        }

        public DauSachDTO(List<String> l)
        {
            _ID = int.Parse(l[0]);
            _Ten = l[1];
            _TheLoai = l[2];
            _TacGia = l[3];
            _LuongTon = int.Parse(l[4]);
        }

        public DauSachDTO(DauSachDTO othr)
        {
            _ID = othr.ID;
            _LuongTon = othr.LuongTon;
            _TacGia = othr.TacGia;
            _Ten = othr.Ten;
            _TheLoai = othr.TheLoai;
        }

        public List<String> ToStringList()
        {
            List<String> r = new List<String>();
            r.Add(_ID.ToString());
            r.Add(_Ten.ToString());
            r.Add(_TheLoai.ToString());
            r.Add(_TacGia.ToString());
            r.Add(_LuongTon.ToString());

            return r;
        }
    }
}
